1. Technical Field
The present invention relates to a nonvolatile memory and a mapping control apparatus and method for the same, and more particularly, to a nonvolatile memory and a mapping control apparatus and method for the same whereby block state information is changed depending on an operation performed by the nonvolatile memory to efficiently access a flash memory.
2. Related Art
In the related art, embedded systems such as electronic home appliances, communication devices, and set top boxes widely employ a nonvolatile memory as a storage medium.
Nonvolatile memory has the advantages of both random access memory (RAM), which freely writes and erases data, and read only memory (ROM), which preserves stored data even in the case of no power supply. Also, the most commonly used related art flash memory is a nonvolatile memory device that can electrically write and erase data. The related art flash memory is suitable for portable devices because of its advantages of small size, lower power consumption than that of magnetic disc memories, and fast access time like hard drives.
The related art flash memory can arbitrarily access data stored in a specified position in the same manner as RAM, nonvolatile memory, and magnetic memory. However, in the case of correcting or erasing data, the flash memory accesses the data in a block unit, unlike related art memory devices. In other words, when the written data is corrected or erased, the block including the data is erased before the data is written.
The aforementioned related art memory supports a logical-physical mapping method that accesses data written in the flash memory through one logical address, even if a physical address is changed due to erasing before writing as above. In other words, this mapping method manages data that maps logical addresses and physical addresses regarding predetermined data through a predetermined mapping table. The mapping method is divided into a sector mapping method, a block mapping method, and a composite mapping method.
Hereinafter, bytes having physically successive addresses are referred to as a sector. “Sector” refers to a data unit of the flash memory. A block composed of a plurality of sectors can be erased by one erasure operation. At this time, the sector is a data operation unit in a small block of the flash memory. For reference, a plurality of sectors is used as a basic unit for data operation in a large block of the flash memory.
FIG. 1 briefly illustrates a sector mapping method of a flash memory according to the related art. The sector mapping method maintains mapping data in a sector of the flash memory in order to access a physical sector of the flash memory using logical sector data. For example, if a logical sector number (LSN) is designated as “9” along with a request for a write operation, an access device of the flash memory retrieves a physical sector number (PSN) 6 corresponding to LSN 9 by referring to the mapping table. Then, corresponding data is written in sector 6 of the flash memory. If other data is written in sector 6, the corresponding data is written in an empty physical sector of the flash memory, and the PSN corresponding to LSN 9 is changed in the mapping table.
FIG. 2 is a view illustrating a block mapping method of a flash memory according to the related art. The block mapping method maintains mapping data in a block unit of the flash memory and converts logical sector data into logical block data to access a physical sector of the flash memory using logical block data and offset data. For example, if an LSN is designated as “9” along with a request for a write operation, the access device of the flash memory obtains a logical block number (LBN) 9/4=2 corresponding to LSN 9, and then obtains a physical block number (PBN) corresponding to the LBN by referring to the mapping table.
At this time, the offset of the logical block coincides with the offset of the physical block so that data is written in a sector corresponding to offset 1 in the obtained PBN 1. If other data is written in a corresponding sector, the corresponding data is written in an empty physical sector of the flash memory by allowing the offsets to coincide with each other, and a PSN corresponding to LBN 2 in the mapping table is changed. At this time, effective data remaining in the existing PBN should be copied to a new PBN by allowing the offsets to coincide with each other.
FIG. 3 is a view illustrating a composite mapping method of a flash memory according to the related art. The composite mapping method performs mapping in a block unit in the same manner as the block mapping method, and then sector mapping data is stored in a physical block to implement sector mapping. For example, if an LSN is designated as “9” along with a request for a write operation, the access device of the flash memory obtains an LBN 9/4=2 corresponding to LSN 9, and then obtains a PBN corresponding to the LBN by referring to the mapping table. Then, the data is written in an empty sector of PBN 1, and LSN 9 is written therein.
This sector mapping method methods has a problem in that it is difficult for the sector mapping method to apply to the flash memory because of excessive mapping data maintained in a sector unit. In this respect, recent technology has been based on a related art block mapping method that requires less mapping data.
However, in the related art block mapping method, since offsets should coincide with each other, a new block should be provided to write data in one sector if one sector is frequently written to. Also, since effective data of another sector in the same block as well as a corresponding sector should be copied, write and erase operations frequently occur, thereby significantly deteriorating system throughput.
Furthermore, in the composite mapping method, since the sector mapping data is stored after block mapping, it is not necessary to make offsets coincide with each other. However, a problem occurs in that a larger memory capacity is required in comparison with the block mapping method because a predetermined area of memory is required to write the sector mapping data.
The related art Korean Patent Unexamined Publication No. 2002-0092487 discloses a method for managing a flash memory in which a predetermined logic block is assigned to write data required for a write operation in the logic block in the procedure for updating data, so as not to degrade system throughput even there are frequent data updates. However, this related art method has a limitation because a write/erase operation is required when moving the data stored in the logic block to a data block. Therefore, it is necessary to provide a method that can improve system throughput of the flash memory by reducing the number of write and erase operations.